import request from '@/utils/request'

// 查询每日行程列表
export function listDailyRecord(query) {
  return request({
    url: '/trip/dailyRecord/list',
    method: 'get',
    params: query
  })
}

// 查询每日行程详细
export function getDailyRecord(tripId) {
  return request({
    url: '/trip/dailyRecord/' + tripId,
    method: 'get'
  })
}
// 查询原始行程
export function queryOriginalInfo(tripId) {
  return request({
    url: '/trip/dailyRecord/queryOriginalInfo/' + tripId,
    method: 'get'
  })
}
// 查询委托行程
export function queryDelegateInfo(tripId) {
  return request({
    url: '/trip/dailyRecord/queryDelegateInfo/' + tripId,
    method: 'get'
  })
}


// 新增每日行程
export function addDailyRecord(data) {
  return request({
    url: '/trip/dailyRecord',
    method: 'post',
    data: data
  })
}
// 行程委派
export function delegateTripRecord(data) {
  return request({
    url: '/trip/dailyRecord/delegate',
    method: 'post',
    data: data
  })
}


// 修改每日行程
export function updateDailyRecord(data) {
  return request({
    url: '/trip/dailyRecord',
    method: 'put',
    data: data
  })
}

// 删除每日行程
export function delDailyRecord(tripId) {
  return request({
    url: '/trip/dailyRecord/' + tripId,
    method: 'delete'
  })
}
// 结算
export function settleDailyRecord(tripId) {
  return request({
    url: '/trip/dailyRecord/settle/' + tripId,
    method: 'put'
  })
}
